home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_trdoor.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  172 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHS_TRdoor.cog      Make the TR door open with monastic seal.  
  4. #
  5. # [JWC, SXC]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13. message     activated
  14. message        startup
  15.  
  16. sector      doorsector
  17.  
  18. sound       placement=tem_tikikey_place_c.wav    local
  19. sound         music0=mus_gen_awesome2.wav            local
  20. sound       doormove=shs_door_double.wav        local
  21.  
  22. keyframe    inReach=in_reach_high.key            local
  23.  
  24.  
  25. thing        door0              linkid=1
  26. thing       door1           linkid=1
  27.  
  28.        
  29. thing        player            local
  30. thing        indy
  31. thing        doorcam1
  32. thing        doorcam_t1
  33. thing        key
  34.  
  35. int          filter=0         local        # prevent multiple activates    
  36. int            whichItem        local 
  37. int            sealKey=87        local         # item define
  38. int            keygrumble=0    local
  39. int            keyed=0            local
  40. int            curcam            local
  41.  
  42. cog            doortalkcog
  43.  
  44.  
  45. end
  46.  
  47. # ========================================================================================
  48.  
  49. code
  50.  
  51.  
  52. startup:
  53.    
  54.     #turn off sector
  55.     SetSectorAdjoins(doorsector, 0);
  56.     SetThingFlags(key, 0x80000);
  57.     SetThingLight(door0, '.1 .1 .1', .01, .01);
  58.     SetThingLight(door1, '.1 .1 .1', .01, .01);
  59.     AttachThingToThing(key, door1);
  60.     player= GetLocalPlayerThing();
  61.     return;
  62.  
  63. activated:
  64.  
  65.     # Check if door is being activated
  66.     If ((GetSenderId() == 1) && (keyed == 0))
  67.     {    
  68.         # Check if inventory is being used...
  69.         whichItem = GetCurItem(player);
  70.         curCam = GetCurrentCamera();
  71.          
  72.         # Prep for scene...
  73.         StartCutScene(1);
  74.         SetActorFlags(player, 0x200000);
  75.         StopThing(player);
  76.         PlayMode(player, 1, 0);    # get him into a nice stand
  77.         DeselectWeapon(player); # stow any weapon or lighter
  78.         DeselectWeaponWait(player);
  79.         CopyPlayerHolsters(player, indy); # make sure actor has matching props
  80.         Sleep(0.1);                            # give him some time to do his stuff
  81.         
  82.         # cut to observe the scene from a known position
  83.         
  84.         # Prep camera & cut...
  85.         SetCameraLookInterp(2, 0);            # kill pan & tilt to lock on 2nd target
  86.         SetCameraPosInterp(2, 0);            # kill dolly mode too
  87.         SetCameraFocus(2, doorcam1);
  88.         SetCameraSecondaryFocus(2, doorcam_t1);
  89.         Sleep(0.01);
  90.         SetCurrentCamera(2);
  91.         SetCameraFOV(55, 0, 0.0);
  92.         
  93.         # Switch actor indy for player...
  94.         SetThingFlags(player, 0x80000);
  95.         ClearThingFlags(indy, 0x80000);
  96.         Sleep(0.5);
  97.         
  98.         if (whichItem == sealKey) 
  99.         {
  100.             PlayKey(indy, inReach, 4, 0x12, 0);
  101.             sleep(1);
  102.             ClearThingFlags(key, 0x80000);
  103.             PlaySoundLocal(placement, 1.0, 0.0, 0x0, 1);
  104.             ChangeInv(player, sealKey, -1);
  105.             
  106.             # "It fits!!!"
  107.             SendMessageEx(doortalkcog, user1, indy, 1, 2, 0);
  108.             while (global15 == 0)
  109.             {
  110.                 Sleep(0.01); # wait for line to finish
  111.             }
  112.             # play some music!
  113.             PlaySoundLocal(music0, 1.0, 0.0, 0x0, 0);
  114.  
  115.             # open doors                         
  116.             SetSectorAdjoins(doorsector, 1);
  117.             sleep(.5);
  118.             Rotate(door0, -90, 1, 4.0);
  119.             Rotate(door1, 90, 1, 4.0);
  120.             PlaySoundLocal(doormove, 1.0, 0.0, 0x0, 0);
  121.             WaitForStop(door0);
  122.               keyed=1;
  123.         }
  124.         else
  125.         {                                
  126.             if (whichItem != 0)
  127.             {
  128.                 # Take care of wrong keys and items...
  129.                 PlayKey(indy, inReach, 4, 0x12, 1);
  130.                 SendMessageEx(doortalkcog, user0, indy, sealKey, whichItem, 0);
  131.             }
  132.             else
  133.             {
  134.                 if (keygrumble == 0)
  135.                 {
  136.                     # Note need for key 1st time thru...
  137.                     SendMessageEx(doortalkcog, user4, indy, 1, 3, 0);
  138.                     keygrumble = 1;
  139.                 }
  140.                 else
  141.                 {
  142.                     # General "door is locked" grmubling thereafter...
  143.                     SendMessageEx(doortalkcog, user4, indy, 0, 0, 0);
  144.                 }
  145.             }
  146.             
  147.             while (global15 == 0)
  148.             {
  149.                 Sleep(0.01); # wait for line to finish
  150.             }
  151.         }
  152.         Sleep(0.3);
  153.         CopyOrientAndPos(indy, player); # move player to actor's spot
  154.         SetCameraPosition(1, GetThingPos(doorcam1));    # prep for camera to swing back
  155.         SetCameraLookInterp(2, 0); # kill pan & tilt mode
  156.         SetCameraPosInterp(2, 0); # kill dolly mode
  157.         Sleep(0.01);
  158.         ResetCameraFOV( 0, 0.0);
  159.         SetCurrentCamera(curCam);
  160.         SetThingFlags(indy, 0x80000);
  161.         ClearThingFlags(player, 0x80000);
  162.         ClearActorFlags(player, 0x200000);
  163.         EndCutScene();
  164.  
  165.         return;
  166.     }
  167.             
  168. end
  169.  
  170.  
  171.  
  172.